local songshu = fk.CreateSkill {

  name = "joy__songshu",

  tags = {  },

}



songshu:addEffect("active", {
  name = "joy__songshu",
  anim_type = "drawcard",
  card_num = 0,
  target_num = 1,
  can_use = function(self, player)
    return not player:isKongcheng() and player:usedSkillTimes(songshu.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and to_select ~= player.id and player:canPindian(Fk:currentRoom():getPlayerById(to_select))
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local pindian = player:pindian({target}, songshu.name)
    if pindian.results[target.id].winner == player then
      player:setSkillUseHistory(songshu.name, 0, Player.HistoryPhase)
    elseif room:askForSkillInvoke(player,songshu.name,nil,"是否令你与 "..Fk:translate(target.general).." 各摸两张牌？") then
      if not player.dead then
        player:drawCards(2, songshu.name)
      end
      if not target.dead then
        target:drawCards(2, songshu.name)
      end
    end
  end,
})

return songshu